import path from "path";
import { createWebHistory, createRouter } from "vue-router";
const layout = () => import("@/layout/index.vue");
const routes = [
  {
    path: "/",
    component: layout,
    meta: {},
    redirect: "home",
    children: [
      {
        path: "home",
        name: "Home",
        component: () => import("@/views/home/index.vue"),
        meta: {},
      },
      {
        path: "test",
        name: "Test",
        component: () => import("@/views/test/index.vue"),
        meta: {},
      },
      {
        path: "ps",
        name: "ps",
        component: () => import("@/views/ps/index.vue"),
        meta: {},
      },
      {
        path: "editor",
        name: "Editor",
        component: () => import("@/views/editor/index.vue"),
        meta: {},
      },
      {
        path: "/editor/404",
        name: "SubEditor",
        component: () => import("@/views/404/index.vue"),
        meta: {},
      }
    ],
  },
  {
    path: "/404",
    component: () => import("@/views/404/index.vue"),
    hidden: true,
  },
  {
    path: "/px_video",
    component: () => import("@/views/pixi-video/index.vue"),
    hidden: true,
  },
  {
    path: "/gsap",
    component: () => import("@/views/gsap/index.vue"),
    hidden: true,
  },
  {
    path: "/goods_persp",
    name: 'GoodsPersp',
    component: () => import("@/views/goods-persp/index.vue"),
    hidden: true,
  },
  {
    path: "/:pathMatch(.*)",
    redirect: "404",
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});
export default router;
